package cn.easier.activity.console.repository;

import cn.easier.activity.web.entity.OptionMessage;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;
import java.util.Collection;
import java.util.List;
import java.util.Optional;

/**
 * 模板信息 Repository
 */
@Repository
public interface OptionMessageRepository extends JpaRepository<OptionMessage, Integer>, JpaSpecificationExecutor<OptionMessage> {

    List<OptionMessage> findAllByQuestionnaireMessageIdAndIsDel(Long questionnaireMessageId, int isDel);

    List<OptionMessage> findAllByQuestionnaireMessageIdInAndIsDel(Collection<Long> questionnaireMessageId, int isDel);

    OptionMessage findByIdAndIsDel(Long id, int isDel);

    Optional<OptionMessage> findById(Long id);

    List<OptionMessage> findByOptionNameAndQuestionnaireMessageIdIn(String optionName, Collection<Long> questionnaireMessageId);
}
